export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  router: {
    // middleware: 'auth'
  },
  env: {
    //因为这里不知道是https还是http 所以直接写两个斜杠 如何拿这个值： process.env.authURL
    // authURL: process.env.NODE_ENV === 'dev' ? '//1.15.92.186:7000' : '//1.15.92.186:7700',
    // authServer: process.env.NODE_ENV === 'dev' ? '//1.15.92.186:7001/auth' : '//1.15.92.186:7001/auth',
    // fileServer: process.env.NODE_ENV === 'dev' ? '//1.15.92.186:7001/file' : '//1.15.92.186:7001/file',
    // blogURL: process.env.NODE_ENV === 'dev' ? '//1.15.92.186:7001/blog' : '//1.15.92.186:7001/blog'
    authURL: process.env.NODE_ENV === 'dev' ? '//127.0.0.1:80' : '//login.shareqxk.cn',
    authServer: process.env.NODE_ENV === 'dev' ? '//127.0.0.1:7001/auth' : '//blog.shareqxk.cn:7001/auth',
    fileServer: process.env.NODE_ENV === 'dev' ? '//127.0.0.1:7001/file' : '//blog.shareqxk.cn:7001/file',
    blogURL: process.env.NODE_ENV === 'dev' ? '//127.0.0.1:7001/blog' : '//blog.shareqxk.cn:7001/blog'
  },
  server: {
    port: 8889,
    // host: '1.15.92.186'
    host: '127.0.0.1'
  },
  head: {
    title: '略懂博客社区站点',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      {charset: 'utf-8'},
      {name: 'viewport', content: 'width=device-width, initial-scale=1'},
      {hid: 'description', name: 'description', content: ''},
      {name: 'format-detection', content: 'java开发 前后端 运维 大数据'}
    ],
    link: [
      {rel: 'icon', type: 'image/x-icon', href: '/my.ico'}
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    //全局引入样式
    //引入element-ui的各种样式
    'element-ui/lib/theme-chalk/index.css',
    //引入布局样式
    'element-ui/lib/theme-chalk/display.css',
    /*渲染编辑器  这种形式引入 加载更快*/
    'mavon-editor/dist/css/index.css'
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    // '@/plugins/vue-inject.js',
    // '@/plugins/ctx-inject.js',
    // '@/plugins/all-inject.js',
    '@/plugins/interceptor.js',
    // '@/api/test.js',
    '@/plugins/element-ui.js',
    '@/api/article.js',
    '@/api/common.js',
    '@/api/question.js',
    '@/api/user.js',
    '@/store/index.js',
    { src: '@/plugins/mavon-editor.js', mode: 'client' }
    // 只希望在服务端运行{src:'@/plugins/all-inject.js',mode:'server'},

  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    '@nuxtjs/axios',
    'cookie-universal-nuxt',//针对服务端操作cookie
  ],
  axios: {
    proxy: true,//开启代理转发
    prefix: '/api'  //请求接口添加前缀 /api
  },
  proxy: {
    // '/api/mock': {// /api/test
    //   target: 'https://mock.mengxuegu.com/mock/6319e5a64944d71a56f26269/blog_init',
    //   pathRewrite: {'^/api/mock': ''}
    // },
    '/api/blogServer': {// /api/test
      // target: 'http://1.15.92.186:7001/blog',
      target: 'http://127.0.0.1:7001/blog',
      pathRewrite: {'^/api/blogServer': ''}
    },
    '/api/fileServer': {// /api/test
      // target: 'http://1.15.92.186:7001/file',
      target: 'http://127.0.0.1:7001/file',
      pathRewrite: {'^/api/fileServer': ''}
    },
  },

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    //将位于node_model下的element-ui导出
    transplie: [/^element-ui/],
    /**
     * webpack自定义配置
     */
    extend(config, ctx) {

    }


  }
}
